Integrand size = 28, antiderivative size = 116 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=2 a^2 (c-i d)^2 x-\frac {2 i a^2 (c-i d)^2 \log (\cos (e+f x))}{f}-\frac {a^2 (c-i d)^2 \tan (e+f x)}{f}+\frac {c d (a+i a \tan (e+f x))^2}{f}-\frac {i d^2 (a+i a \tan (e+f x))^3}{3 a f} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3624, 3608, 3558, 3556} \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=-\frac {a^2 (c-i d)^2 \tan (e+f x)}{f}-\frac {2 i a^2 (c-i d)^2 \log (\cos (e+f x))}{f}+2 a^2 x (c-i d)^2+\frac {c d (a+i a \tan (e+f x))^2}{f}-\frac {i d^2 (a+i a \tan (e+f x))^3}{3 a f} \]
[In]
[Out]
Rule 3556
Rule 3558
Rule 3608
Rule 3624
Rubi steps \begin{align*} \text {integral}& = -\frac {i d^2 (a+i a \tan (e+f x))^3}{3 a f}+\int (a+i a \tan (e+f x))^2 \left (c^2-d^2+2 c d \tan (e+f x)\right ) \, dx \\ & = \frac {c d (a+i a \tan (e+f x))^2}{f}-\frac {i d^2 (a+i a \tan (e+f x))^3}{3 a f}+(c-i d)^2 \int (a+i a \tan (e+f x))^2 \, dx \\ & = 2 a^2 (c-i d)^2 x-\frac {a^2 (c-i d)^2 \tan (e+f x)}{f}+\frac {c d (a+i a \tan (e+f x))^2}{f}-\frac {i d^2 (a+i a \tan (e+f x))^3}{3 a f}+\left (2 i a^2 (c-i d)^2\right ) \int \tan (e+f x) \, dx \\ & = 2 a^2 (c-i d)^2 x-\frac {2 i a^2 (c-i d)^2 \log (\cos (e+f x))}{f}-\frac {a^2 (c-i d)^2 \tan (e+f x)}{f}+\frac {c d (a+i a \tan (e+f x))^2}{f}-\frac {i d^2 (a+i a \tan (e+f x))^3}{3 a f} \\ \end{align*}
Time = 1.19 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.86 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=\frac {a^2 \left ((3 c-i d) d+6 i (c-i d)^2 \log (i+\tan (e+f x))-3 \left (c^2-4 i c d-2 d^2\right ) \tan (e+f x)-3 (c-i d) d \tan ^2(e+f x)-d^2 \tan ^3(e+f x)\right )}{3 f} \]
[In]
[Out]
Time = 0.28 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.16
method | result | size |
derivativedivides | \(\frac {a^{2} \left (i d^{2} \left (\tan ^{2}\left (f x +e \right )\right )-\frac {d^{2} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+4 i c d \tan \left (f x +e \right )-c d \left (\tan ^{2}\left (f x +e \right )\right )-c^{2} \tan \left (f x +e \right )+2 d^{2} \tan \left (f x +e \right )+\frac {\left (2 i c^{2}-2 i d^{2}+4 c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-4 i c d +2 c^{2}-2 d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(135\) |
default | \(\frac {a^{2} \left (i d^{2} \left (\tan ^{2}\left (f x +e \right )\right )-\frac {d^{2} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+4 i c d \tan \left (f x +e \right )-c d \left (\tan ^{2}\left (f x +e \right )\right )-c^{2} \tan \left (f x +e \right )+2 d^{2} \tan \left (f x +e \right )+\frac {\left (2 i c^{2}-2 i d^{2}+4 c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-4 i c d +2 c^{2}-2 d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(135\) |
norman | \(\left (-4 i a^{2} c d +2 a^{2} c^{2}-2 a^{2} d^{2}\right ) x -\frac {\left (-i a^{2} d^{2}+a^{2} c d \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{f}-\frac {\left (-4 i a^{2} c d +a^{2} c^{2}-2 a^{2} d^{2}\right ) \tan \left (f x +e \right )}{f}-\frac {a^{2} d^{2} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {i a^{2} \left (-2 i c d +c^{2}-d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}\) | \(146\) |
parts | \(a^{2} c^{2} x +\frac {\left (2 i a^{2} c^{2}+2 a^{2} c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (2 i a^{2} d^{2}-2 a^{2} c d \right ) \left (\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}\right )}{f}+\frac {\left (4 i a^{2} c d -a^{2} c^{2}+a^{2} d^{2}\right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}-\frac {a^{2} d^{2} \left (\frac {\left (\tan ^{3}\left (f x +e \right )\right )}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(169\) |
parallelrisch | \(\frac {-12 i x \,a^{2} c d f +3 i \left (\tan ^{2}\left (f x +e \right )\right ) a^{2} d^{2}-a^{2} d^{2} \left (\tan ^{3}\left (f x +e \right )\right )+3 i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} c^{2}-3 i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} d^{2}+12 i \tan \left (f x +e \right ) a^{2} c d +6 x \,a^{2} c^{2} f -6 x \,a^{2} d^{2} f -3 \left (\tan ^{2}\left (f x +e \right )\right ) a^{2} c d +6 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} c d -3 \tan \left (f x +e \right ) a^{2} c^{2}+6 \tan \left (f x +e \right ) a^{2} d^{2}}{3 f}\) | \(185\) |
risch | \(\frac {8 i a^{2} c d e}{f}-\frac {4 a^{2} c^{2} e}{f}+\frac {4 a^{2} d^{2} e}{f}-\frac {2 i a^{2} \left (3 c^{2} {\mathrm e}^{4 i \left (f x +e \right )}-15 d^{2} {\mathrm e}^{4 i \left (f x +e \right )}-18 i c d \,{\mathrm e}^{4 i \left (f x +e \right )}+6 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}-18 d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-30 i c d \,{\mathrm e}^{2 i \left (f x +e \right )}+3 c^{2}-7 d^{2}-12 i c d \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {4 a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c d}{f}-\frac {2 i a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{2}}{f}+\frac {2 i a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d^{2}}{f}\) | \(230\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (100) = 200\).
Time = 0.24 (sec) , antiderivative size = 277, normalized size of antiderivative = 2.39 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=-\frac {2 \, {\left (3 i \, a^{2} c^{2} + 12 \, a^{2} c d - 7 i \, a^{2} d^{2} + 3 \, {\left (i \, a^{2} c^{2} + 6 \, a^{2} c d - 5 i \, a^{2} d^{2}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 6 \, {\left (i \, a^{2} c^{2} + 5 \, a^{2} c d - 3 i \, a^{2} d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 3 \, {\left (i \, a^{2} c^{2} + 2 \, a^{2} c d - i \, a^{2} d^{2} + {\left (i \, a^{2} c^{2} + 2 \, a^{2} c d - i \, a^{2} d^{2}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, a^{2} c^{2} + 2 \, a^{2} c d - i \, a^{2} d^{2}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, a^{2} c^{2} + 2 \, a^{2} c d - i \, a^{2} d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 236 vs. \(2 (97) = 194\).
Time = 0.42 (sec) , antiderivative size = 236, normalized size of antiderivative = 2.03 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=- \frac {2 i a^{2} \left (c - i d\right )^{2} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 6 i a^{2} c^{2} - 24 a^{2} c d + 14 i a^{2} d^{2} + \left (- 12 i a^{2} c^{2} e^{2 i e} - 60 a^{2} c d e^{2 i e} + 36 i a^{2} d^{2} e^{2 i e}\right ) e^{2 i f x} + \left (- 6 i a^{2} c^{2} e^{4 i e} - 36 a^{2} c d e^{4 i e} + 30 i a^{2} d^{2} e^{4 i e}\right ) e^{4 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.24 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=-\frac {a^{2} d^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (a^{2} c d - i \, a^{2} d^{2}\right )} \tan \left (f x + e\right )^{2} - 6 \, {\left (a^{2} c^{2} - 2 i \, a^{2} c d - a^{2} d^{2}\right )} {\left (f x + e\right )} - 3 \, {\left (i \, a^{2} c^{2} + 2 \, a^{2} c d - i \, a^{2} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 3 \, {\left (a^{2} c^{2} - 4 i \, a^{2} c d - 2 \, a^{2} d^{2}\right )} \tan \left (f x + e\right )}{3 \, f} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 482 vs. \(2 (100) = 200\).
Time = 0.57 (sec) , antiderivative size = 482, normalized size of antiderivative = 4.16 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=-\frac {2 \, {\left (3 i \, a^{2} c^{2} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 6 \, a^{2} c d e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 3 i \, a^{2} d^{2} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 i \, a^{2} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 \, a^{2} c d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 9 i \, a^{2} d^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 i \, a^{2} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 18 \, a^{2} c d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 9 i \, a^{2} d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 3 i \, a^{2} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 18 \, a^{2} c d e^{\left (4 i \, f x + 4 i \, e\right )} - 15 i \, a^{2} d^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 6 i \, a^{2} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 30 \, a^{2} c d e^{\left (2 i \, f x + 2 i \, e\right )} - 18 i \, a^{2} d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 3 i \, a^{2} c^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 6 \, a^{2} c d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 3 i \, a^{2} d^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 3 i \, a^{2} c^{2} + 12 \, a^{2} c d - 7 i \, a^{2} d^{2}\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]
[In]
[Out]
Time = 6.02 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.20 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2 \, dx=\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^2\,d^2\,1{}\mathrm {i}}{2}+\frac {a^2\,d\,\left (d+c\,2{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,d^2+a^2\,d\,\left (d+c\,2{}\mathrm {i}\right )+a^2\,c\,\left (2\,d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a^2\,c^2\,2{}\mathrm {i}+4\,a^2\,c\,d-a^2\,d^2\,2{}\mathrm {i}\right )}{f}-\frac {a^2\,d^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f} \]
[In]
[Out]